<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="con" style="border: red 2px solid; width: 400px; height: 300px;padding: 0;">
        <img src="./images/fruit1.png" width="200px" height="200px"/>
        <!-- <a href="#" onmouseover="this.style.fontSize='30px'">沙比</a> -->
    </div>
    
</body>
<script>

    var con = document.getElementById("con");

    //鼠标移到
    con.onmouseover = function(){
        this.style.border = "2px solid blue";
    }
   
    //鼠标按下
    con.onmousedown = function(){
        this.style.backgroundColor = "pink";
    }
   
    //鼠标地松开
    con.onmouseup = function(){
        this.style.backgroundColor = "white";
    }
   //点击
    con.onclick = function(){
        console.log(this.style.width, this.style.height);
    }
</script>
</html>